<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
[#include "../common/head.html"/]
[@head title="quotarecord.list.title"/]
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed page-quick-sidebar-over-content">
[#include "../common/top.html"/]
<!-- BEGIN CONTAINER -->
<div class="page-container">
	[#include "../common/left.html"/]
	[@menu menu="user" submenu="quota-record"/]
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div id="ajax-modal" class="modal fade bs-modal" tabindex="-1"></div>
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- Begin: life time stats -->
					<div class="portlet">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-list-ul"></i>[@spring.message code="quotarecord.list.caption"/]
							</div>
						</div>
						<div class="portlet-body">
							<div class="table-container">
								<div class="table-actions-wrapper"></div>
								<table class="table table-striped table-bordered table-hover" id="datatable_quotarecords">
									<thead>
										<tr role="row" class="heading">
											<th style="text-align: center; width: 85px">[@spring.message code="datatable.column.operation"/]</th>
											<th>[@spring.message code="quotarecord.list.datatable.column.userName"/]</th>
											<th>[@spring.message code="quotarecord.list.datatable.column.type"/]</th>
											<th>[@spring.message code="quotarecord.list.datatable.column.rebatePoint"/]</th>
											<th>[@spring.message code="quotarecord.list.datatable.column.in"/]</th>
		                                    <th>[@spring.message code="quotarecord.list.datatable.column.out"/]</th>
		                                    <th>[@spring.message code="quotarecord.list.datatable.column.childName"/]</th>
		                                    <th>[@spring.message code="datatable.column.createdDate"/]</th>
										</tr>
										<tr role="row" class="filter">
		                                	<td style="text-align: center;">
												<div class="margin-bottom-5">
													<button class="btn btn-sm yellow filter-submit margin-bottom"><i class="fa fa-search"></i> [@spring.message code="datatable.filter.search"/]</button>
												</div>
												<button class="btn btn-sm red filter-cancel"><i class="fa fa-times"></i> [@spring.message code="datatable.filter.reset"/]</button>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_userName">
											</td>
											<td>
												<input name="search_EQ_direction" type="hidden" class="form-control form-filter input-sm">
												<select name="search_EQ_type" class="form-control form-filter input-sm">
													<option value="">[@spring.message code="datatable.filter.select"/]</option>
													<option value="" data-direction="IN">[@spring.message code="net.lanelife.casino.caipiao.entity.QuotaRecord.Direction.IN"/]</option>
		                                            [#list enums["net.lanelife.casino.caipiao.entity.QuotaRecord$Type"]?values as item]
			                                            [#if item.name().startsWith("IN")]
															<option value="${item.name()}">&nbsp;&nbsp;&nbsp;&nbsp;[@spring.message code="net.lanelife.casino.caipiao.entity.QuotaRecord.Type."+item.name()/]</option>
														[/#if]
													[/#list]
													<option value="" data-direction="OUT">[@spring.message code="net.lanelife.casino.caipiao.entity.QuotaRecord.Direction.OUT"/]</option>
		                                            [#list enums["net.lanelife.casino.caipiao.entity.QuotaRecord$Type"]?values as item]
													    [#if item.name().startsWith("OUT")]
															<option value="${item.name()}">&nbsp;&nbsp;&nbsp;&nbsp;[@spring.message code="net.lanelife.casino.caipiao.entity.QuotaRecord.Type."+item.name()/]</option>
														[/#if]
													[/#list]
												</select>
											</td>
											<td>
												<div class="margin-bottom-5">
													<input type="text" class="form-control form-filter input-sm" name="search_EQ_beginRebatePoint" placeholder="[@spring.message code="datatable.filter.from"/]"/>
												</div>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_endRebatePoint" placeholder="[@spring.message code="datatable.filter.to"/]"/>
											</td>
											<td colspan="2">
												<div class="margin-bottom-5">
													<input type="text" class="form-control form-filter input-sm" name="search_GTE_quota" placeholder="[@spring.message code="datatable.filter.from"/]"/>
												</div>
												<input type="text" class="form-control form-filter input-sm" name="search_LTE_quota" placeholder="[@spring.message code="datatable.filter.to"/]"/>
											</td>
											<td>
												<input type="text" class="form-control form-filter input-sm" name="search_EQ_childName">
											</td>
											<td>
												<div class="input-group date date-picker margin-bottom-5" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_GTE_createdDate" placeholder="[@spring.message code="datatable.filter.from"/]" value="${.now?date} 00:00:00"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
												<div class="input-group date date-picker" data-date-format="yyyy-MM-dd HH:mm:ss">
													<input type="text" class="form-control form-filter input-sm" readonly name="search_LTE_createdDate" placeholder="[@spring.message code="datatable.filter.to"/]" value="${.now?date} 23:59:59"/>
													<span class="input-group-btn">
														<button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
													</span>
												</div>
											</td>
										</tr>
									</thead>
									<tbody>
									</tbody>
									<tfoot>
										<tr>
		                                	<td style="text-align: center;">[@spring.message code="datatable.footer.aggregate"/]</td>
											<td></td>
											<td></td>
											<td></td>
											<td id="aggregate_inQuota"></td>
											<td id="aggregate_outQuota"></td>
											<td></td>
		                                    <td></td>
										</tr>
									</tfoot>
								</table>
							</div>
						</div>
					</div>
					<!-- End: life time stats -->
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->

[#include "../common/foot.html"/]

[#assign path="${ctx}/quota-record"/]

<script type="text/javascript">
jQuery(document).ready(function() {
	
	$('select[name="search_EQ_type"]').change(function(e){
		$('input[name="search_EQ_direction"]').val($(this).find('option:selected').attr('data-direction') || '');
	});
	
    grid.init({
        src: $("#datatable_quotarecords"),
        fixedColumns: 1,
        onSuccess: function (data) { },
        onError: function (data) { },
        dataTable: {
            "pageLength": 10,
            "ajax": {"url": "${path}"},
            "columnDefs": [{'orderable': false, 'targets': [0,4,5]}],
            "columns": [
                {"render": function(data,type,full) {
					return '<div class="btn-group"></div>';
				}},
                {"data": "userName"},
                {"data": "type", "render": function(data,type,full) {
					return message['net.lanelife.casino.caipiao.entity.QuotaRecord.Type.' + data];
				}},
				{"data": "beginRebatePoint", "render": function(data,type,full) {
					return full.beginRebatePoint + ' - ' + full.endRebatePoint;
				}},
				{"data": "quota", "render": function(data,type,full) {
					return full.direction == 'IN' ? data : '';
				}},
				{"data": "quota", "render": function(data,type,full) {
					return full.direction == 'OUT' ? data : '';
				}},
				{"data": "childName"},
				{"data": "createdDate"}
            ],
            "order": [
                [7, "desc"]
            ]
        }
    });
});
</script>

</body>
<!-- END BODY -->
</html>